﻿Imports System.ComponentModel
Imports DevExpress.Skins
Imports DevExpress.LookAndFeel
Imports DevExpress.UserSkins
Imports DevExpress.XtraBars
Imports DevExpress.XtraBars.Ribbon
Imports DevExpress.XtraBars.Helpers
Imports DevExpress.XtraSplashScreen
Imports DevExpress.XtraEditors
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid

Public Class KH_TonKho
 
    Private Sub KH_TonKho_Load(sender As Object, e As EventArgs) Handles Me.Load
        'load tháng hiện tại
        Me.TuNgayIDateEdit.EditValue = getNgayDauThang(Today)
        Me.DenNgayIDateEdit.EditValue = getNgayCuoiThang(Today)
        'kiểm tra có đầu kỳ chưa
        If Me.TcTonKhoTableAdapter1.getTCTonKho_isTonTai_DauKy(getRecycleId(CDate(Me.TuNgayIDateEdit.EditValue))) = 0 Then
            TcTonKhoTableAdapter1.setTCTonKho_LayDauKy(getRecycleId(CDate(Me.TuNgayIDateEdit.EditValue)), getPreRecycleId(CDate(Me.TuNgayIDateEdit.EditValue)))
        End If
        Me.GetTCTonKho_TonKhoTheoLo_HanDungTableAdapter.Fill(Me.PCV_FISHDataSet.getTCTonKho_TonKhoTheoLo_HanDung, getRecycleId(CDate(Me.TuNgayIDateEdit.EditValue)))
    End Sub

    Private Sub BarButtonItemLamTuoi_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItemLamTuoi.ItemClick
        If GetTCTonKho_TonKhoTheoLo_HanDungTableAdapter.ClearBeforeFill Then
            Me.GetTCTonKho_TonKhoTheoLo_HanDungTableAdapter.Fill(Me.PCV_FISHDataSet.getTCTonKho_TonKhoTheoLo_HanDung, getRecycleId(CDate(Me.TuNgayIDateEdit.EditValue)))
        End If
    End Sub
End Class
